﻿[assembly: CommandClass(typeof(CADSecondDevelopTemplate.CadCmds))]

namespace CADSecondDevelopTemplate;

public partial class CadCmds
{
    private PaletteSet? MainSet { get; set; } = null;
  
    [CommandMethod(nameof(HelloCAD), CommandFlags.Session | CommandFlags.UsePickSet)]
    public void HelloCAD()
    {
        if (MainSet == null || MainSet.Visible == false)
        {
            MainSet = new PaletteSet("ToolBox");
            ElementHost host = new()
            {
                AutoSize = true,
                Dock = DockStyle.Fill,
                Child = new Main()
            };
            MainSet.Add("Add ElementHost", host);
            MainSet.Visible = true;
            MainSet.Size = new System.Drawing.Size(254, 645);
            MainSet.Dock = DockSides.Left;
        }
    }
}
